home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / ControlStrip.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  11.7 KB  |  401 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        ControlStrip.a
  3. ;
  4. ;    Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5. ;
  6. ;    Version:    Technology:    ControlStrip 1.4
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1992-1997 by Apple Computer, Inc. All rights reserved.
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__CONTROLSTRIP__') = 'UNDEFINED' THEN
  19. __CONTROLSTRIP__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  25.     include 'Menus.a'
  26.     ENDIF
  27.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  28.     include 'Dialogs.a'
  29.     ENDIF
  30.  
  31. ; *********************************************************************************************
  32. ;
  33. ;    messages passed to the modules
  34. ;
  35. ;********************************************************************************************
  36.  
  37.  
  38. sdevInitModule                    EQU        0                    ; initialize the module
  39. sdevCloseModule                    EQU        1                    ; clean up before being closed
  40. sdevFeatures                    EQU        2                    ; return feature bits
  41. sdevGetDisplayWidth                EQU        3                    ; returns the width of the module's display
  42. sdevPeriodicTickle                EQU        4                    ; periodic tickle when nothing else is happening
  43. sdevDrawStatus                    EQU        5                    ; update the interface in the Control Strip
  44. sdevMouseClick                    EQU        6                    ; user clicked on the module's display area in the Control Strip
  45. sdevSaveSettings                EQU        7                    ; saved any changed settings in module's preferences file
  46. sdevShowBalloonHelp                EQU        8                    ; puts up a help balloon, if the module has one to display
  47. ; *********************************************************************************************
  48. ;
  49. ;    Features supported by the module.  If a bit is set, it means that feature is supported.
  50. ;    All undefined bits are reserved for future use by Apple, and should be set to zero.
  51. ;
  52. ;********************************************************************************************
  53.  
  54.  
  55. sdevWantMouseClicks                EQU        0                    ; notify the module of mouseDown events
  56. sdevDontAutoTrack                EQU        1                    ; call the module to do mouse tracking
  57. sdevHasCustomHelp                EQU        2                    ; module provides its own help messages
  58. sdevKeepModuleLocked            EQU        3                    ; module needs to be locked in the heap
  59. ; *********************************************************************************************
  60. ;
  61. ;    Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  62. ;    If a bit is set, the module can request that a specific function is performed by
  63. ;    the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  64. ;    for future use by Apple, and should be set to zero.
  65. ;
  66. ;********************************************************************************************
  67.  
  68.  
  69. sdevResizeDisplay                EQU        0                    ; resize the module's display
  70. sdevNeedToSave                    EQU        1                    ; need to save changed settings, when convenient
  71. sdevHelpStateChange                EQU        2                    ; need to update the help message because of a state change
  72. sdevCloseNow                    EQU        3                    ; close a module because it doesn't want to stay around
  73.  
  74. ; *********************************************************************************************
  75. ;
  76. ;    miscellaneous
  77. ;
  78. ;********************************************************************************************
  79.  
  80.  
  81. sdevFileType                    EQU        'sdev'                ; module's file type
  82.  
  83. sdevMenuItemMark                EQU        $A5                    ; ‘•’: ‘checkmark’ to use in popup menus
  84.  
  85. ;     direction values for SBDrawBarGraph
  86.  
  87.  
  88. BarGraphSlopeLeft                EQU        -1                    ; max end of sloping bar graph is on the left
  89. BarGraphFlatRight                EQU        0                    ; max end of flat bar graph is on the right
  90. BarGraphSlopeRight                EQU        1                    ; max end of sloping bar graph is on the right
  91. ; *********************************************************************************************
  92. ;
  93. ;    utility routines to provide standard interface elements and support for common functions
  94. ;
  95. ;********************************************************************************************
  96.  
  97. ;
  98. ; pascal Boolean SBIsControlStripVisible(void )
  99. ;
  100.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  101.         Macro
  102.         _SBIsControlStripVisible
  103.             moveq               #0,D0
  104.             dc.w                $AAF2
  105.         EndM
  106.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  107.         IMPORT_CFM_FUNCTION SBIsControlStripVisible
  108.     ENDIF
  109.  
  110. ;
  111. ; pascal void SBShowHideControlStrip(Boolean showIt)
  112. ;
  113.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  114.         Macro
  115.         _SBShowHideControlStrip
  116.             move.w              #$0101,D0
  117.             dc.w                $AAF2
  118.         EndM
  119.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  120.         IMPORT_CFM_FUNCTION SBShowHideControlStrip
  121.     ENDIF
  122.  
  123. ;
  124. ; pascal Boolean SBSafeToAccessStartupDisk(void )
  125. ;
  126.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  127.         Macro
  128.         _SBSafeToAccessStartupDisk
  129.             moveq               #2,D0
  130.             dc.w                $AAF2
  131.         EndM
  132.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  133.         IMPORT_CFM_FUNCTION SBSafeToAccessStartupDisk
  134.     ENDIF
  135.  
  136. ;
  137. ; pascal short SBOpenModuleResourceFile(OSType fileCreator)
  138. ;
  139.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  140.         Macro
  141.         _SBOpenModuleResourceFile
  142.             move.w              #$0203,D0
  143.             dc.w                $AAF2
  144.         EndM
  145.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  146.         IMPORT_CFM_FUNCTION SBOpenModuleResourceFile
  147.     ENDIF
  148.  
  149. ;
  150. ; pascal OSErr SBLoadPreferences(ConstStr255Param prefsResourceName, Handle *preferences)
  151. ;
  152.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  153.         Macro
  154.         _SBLoadPreferences
  155.             move.w              #$0404,D0
  156.             dc.w                $AAF2
  157.         EndM
  158.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  159.         IMPORT_CFM_FUNCTION SBLoadPreferences
  160.     ENDIF
  161.  
  162. ;
  163. ; pascal OSErr SBSavePreferences(ConstStr255Param prefsResourceName, Handle preferences)
  164. ;
  165.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  166.         Macro
  167.         _SBSavePreferences
  168.             move.w              #$0405,D0
  169.             dc.w                $AAF2
  170.         EndM
  171.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  172.         IMPORT_CFM_FUNCTION SBSavePreferences
  173.     ENDIF
  174.  
  175. ;
  176. ; pascal void SBGetDetachedIndString(StringPtr theString, Handle stringList, short whichString)
  177. ;
  178.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  179.         Macro
  180.         _SBGetDetachedIndString
  181.             move.w              #$0506,D0
  182.             dc.w                $AAF2
  183.         EndM
  184.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  185.         IMPORT_CFM_FUNCTION SBGetDetachedIndString
  186.     ENDIF
  187.  
  188. ;
  189. ; pascal OSErr SBGetDetachIconSuite(Handle *theIconSuite, short theResID, unsigned long selector)
  190. ;
  191.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  192.         Macro
  193.         _SBGetDetachIconSuite
  194.             move.w              #$0507,D0
  195.             dc.w                $AAF2
  196.         EndM
  197.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  198.         IMPORT_CFM_FUNCTION SBGetDetachIconSuite
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal short SBTrackPopupMenu(const Rect *moduleRect, MenuHandle theMenu)
  203. ;
  204.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  205.         Macro
  206.         _SBTrackPopupMenu
  207.             move.w              #$0408,D0
  208.             dc.w                $AAF2
  209.         EndM
  210.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  211.         IMPORT_CFM_FUNCTION SBTrackPopupMenu
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal short SBTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue)
  216. ;
  217.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  218.         Macro
  219.         _SBTrackSlider
  220.             move.w              #$0409,D0
  221.             dc.w                $AAF2
  222.         EndM
  223.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  224.         IMPORT_CFM_FUNCTION SBTrackSlider
  225.     ENDIF
  226.  
  227. ;
  228. ; pascal OSErr SBShowHelpString(const Rect *moduleRect, StringPtr helpString)
  229. ;
  230.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  231.         Macro
  232.         _SBShowHelpString
  233.             move.w              #$040A,D0
  234.             dc.w                $AAF2
  235.         EndM
  236.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  237.         IMPORT_CFM_FUNCTION SBShowHelpString
  238.     ENDIF
  239.  
  240. ;
  241. ; pascal short SBGetBarGraphWidth(short barCount)
  242. ;
  243.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  244.         Macro
  245.         _SBGetBarGraphWidth
  246.             move.w              #$010B,D0
  247.             dc.w                $AAF2
  248.         EndM
  249.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  250.         IMPORT_CFM_FUNCTION SBGetBarGraphWidth
  251.     ENDIF
  252.  
  253. ;
  254. ; pascal void SBDrawBarGraph(short level, short barCount, short direction, Point barGraphTopLeft)
  255. ;
  256.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  257.         Macro
  258.         _SBDrawBarGraph
  259.             move.w              #$050C,D0
  260.             dc.w                $AAF2
  261.         EndM
  262.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  263.         IMPORT_CFM_FUNCTION SBDrawBarGraph
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void SBModalDialogInContext(ModalFilterUPP filterProc, short *itemHit)
  268. ;
  269.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  270.         Macro
  271.         _SBModalDialogInContext
  272.             move.w              #$040D,D0
  273.             dc.w                $AAF2
  274.         EndM
  275.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  276.         IMPORT_CFM_FUNCTION SBModalDialogInContext
  277.     ENDIF
  278.  
  279. ;  The following routines are available in Control Strip 1.2 and later. 
  280. ;
  281. ; pascal OSErr SBGetControlStripFontID(short *fontID)
  282. ;
  283.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  284.         Macro
  285.         _SBGetControlStripFontID
  286.             move.w              #$020E,D0
  287.             dc.w                $AAF2
  288.         EndM
  289.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  290.         IMPORT_CFM_FUNCTION SBGetControlStripFontID
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal OSErr SBSetControlStripFontID(short fontID)
  295. ;
  296.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  297.         Macro
  298.         _SBSetControlStripFontID
  299.             move.w              #$010F,D0
  300.             dc.w                $AAF2
  301.         EndM
  302.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION SBSetControlStripFontID
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal OSErr SBGetControlStripFontSize(short *fontSize)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  310.         Macro
  311.         _SBGetControlStripFontSize
  312.             move.w              #$0210,D0
  313.             dc.w                $AAF2
  314.         EndM
  315.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  316.         IMPORT_CFM_FUNCTION SBGetControlStripFontSize
  317.     ENDIF
  318.  
  319. ;
  320. ; pascal OSErr SBSetControlStripFontSize(short fontSize)
  321. ;
  322.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  323.         Macro
  324.         _SBSetControlStripFontSize
  325.             move.w              #$0111,D0
  326.             dc.w                $AAF2
  327.         EndM
  328.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  329.         IMPORT_CFM_FUNCTION SBSetControlStripFontSize
  330.     ENDIF
  331.  
  332. ;
  333. ; pascal OSErr SBGetShowHideHotKey(short *modifiers, unsigned char *keyCode)
  334. ;
  335.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  336.         Macro
  337.         _SBGetShowHideHotKey
  338.             move.w              #$0412,D0
  339.             dc.w                $AAF2
  340.         EndM
  341.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  342.         IMPORT_CFM_FUNCTION SBGetShowHideHotKey
  343.     ENDIF
  344.  
  345. ;
  346. ; pascal OSErr SBSetShowHideHotKey(short modifiers, unsigned char keyCode)
  347. ;
  348.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  349.         Macro
  350.         _SBSetShowHideHotKey
  351.             move.w              #$0213,D0
  352.             dc.w                $AAF2
  353.         EndM
  354.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  355.         IMPORT_CFM_FUNCTION SBSetShowHideHotKey
  356.     ENDIF
  357.  
  358. ;
  359. ; pascal OSErr SBIsShowHideHotKeyEnabled(Boolean *enabled)
  360. ;
  361.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  362.         Macro
  363.         _SBIsShowHideHotKeyEnabled
  364.             move.w              #$0214,D0
  365.             dc.w                $AAF2
  366.         EndM
  367.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  368.         IMPORT_CFM_FUNCTION SBIsShowHideHotKeyEnabled
  369.     ENDIF
  370.  
  371. ;
  372. ; pascal OSErr SBEnableShowHideHotKey(Boolean enabled)
  373. ;
  374.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  375.         Macro
  376.         _SBEnableShowHideHotKey
  377.             move.w              #$0115,D0
  378.             dc.w                $AAF2
  379.         EndM
  380.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  381.         IMPORT_CFM_FUNCTION SBEnableShowHideHotKey
  382.     ENDIF
  383.  
  384. ;  The following routines are available in Control Strip 1.4 and later. 
  385. ;
  386. ; pascal short SBHitTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue, Boolean *hit)
  387. ;
  388.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  389.         Macro
  390.         _SBHitTrackSlider
  391.             move.w              #$0616,D0
  392.             dc.w                $AAF2
  393.         EndM
  394.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  395.         IMPORT_CFM_FUNCTION SBHitTrackSlider
  396.     ENDIF
  397.  
  398.  
  399.     ENDIF ; __CONTROLSTRIP__ 
  400.  
  401.